<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'

onLaunch(() => {
  console.log('App Launch')
  uni.showShareMenu({
    // https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html
    withShareTicket: true,
    menus: ['shareAppMessage', 'shareTimeline'], //开启转发好友和转发朋友圈按钮
    success(result) {
      console.log('分享成功', result)
    },
  });
})
onShow(() => {
  console.log('App Show')
})
onHide(() => {
  console.log('App Hide')
})
onShareAppMessage((res) => {
  if (res.from === 'button') {// 来自页面内分享按钮
    console.log(res, '123123')
  }
  return {
    title:'邀请您成为新用户',
    path: '/pages/login/index/?id=1',
    imageUrl: '../../../static/images/img.png',
    desc:'213312',
    content:'123',
  }
})
</script>

<style lang="scss">
/* stylelint-disable selector-type-no-unknown */
button::after {
  border: none;
}

swiper,
scroll-view {
  flex: 1;
  height: 100%;
  overflow: hidden;
}

image {
  width: 100%;
  height: 100%;
  vertical-align: middle;
}

// 单行省略，优先使用 unocss: text-ellipsis
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

// 两行省略
.ellipsis-2 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

// 三行省略
.ellipsis-3 {
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
</style>
